//package com.wyd.flowable.config;
//
//import org.springframework.boot.web.servlet.ServletContextInitializer;
//import org.springframework.context.annotation.Configuration;
//
//import javax.servlet.ServletContext;
//import java.util.Collections;
//import java.util.HashMap;
//import java.util.Map;
//
///**
// * @author 王叶东
// * @since 2025/6/12 11:13
// */
//@Configuration
//public class ModelerInitializer implements ServletContextInitializer {
//    @Override
//    public void onStartup(ServletContext servletContext) {
//        // 禁用登录拦截
//        servletContext.setInitParameter("flowable.authenticated", "false");
//
//        // 设置默认用户(模拟已登录状态)
//        servletContext.setAttribute("flowableUser", createAnonymousUser());
//    }
//
//    private Map<String, Object> createAnonymousUser() {
//        Map<String, Object> user = new HashMap<>();
//        user.put("id", "anonymous");
//        user.put("firstName", "Anonymous");
//        user.put("lastName", "User");
//        user.put("email", "anonymous@example.com");
//        user.put("privileges", Collections.singletonList("access-modeler"));
//        return user;
//    }
//}
